﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ColorClusteringSOM.Evaluation
{
    class EvaluationAlgoritms
    {
        private List<NeuronRough> leaders = null;

        private int clustersCount = -1;
        private int neuronCount = -1;

        // bude to ve velikosti C x N  
        //  C ... pocet klustru
        //  N ... pocet neuronu
        private double[,] membershipMatrix = null;

        public EvaluationAlgoritms(List<NeuronRough> leaders, int clustersCount, int neuronCount)
        {
            this.leaders = leaders;
            this.clustersCount = clustersCount;
            this.neuronCount = neuronCount;

            this.membershipMatrix = new double[clustersCount, neuronCount];
        }


        private void MakeMembershipMatrix()
        {

            double no = 0; //nepatri do klastru
            double yes = 1; // patri do dolni aproximace
            double maybe = 0.5; // patri do horni aproximace

            foreach (NeuronRough cluster in leaders)
            {
                foreach (NeuronRough neuron in cluster.LowerAppNeuronsArray)
                {
                    membershipMatrix[cluster.LeaderNumber, neuron.NumberOfNeuron] = yes;
                }

                foreach (NeuronRough neuron in cluster.UpperAppNeuronsArray)
                {
                    membershipMatrix[cluster.LeaderNumber, neuron.NumberOfNeuron] = maybe;
                }

            }
        }


    }
}
